package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * 消息发送类型
 * @author 木叶丸
 * @date 2018/5/25
 */
@Getter
public enum MessageSendType {

    WORK_ORDER_UNSETTLED_MSG("1", "工单结算待确认消息通知", "0jQ4cwDEhPSW0dDCUo8txCQJqOdvnxNp0aRm0oqMdrg"),
    WORK_ORDER_UNEVALUATE_MSG("2", "工单结算待评价消息通知", "w5YZrRCyl-fzJTQE0OE5K3shNnqofgQAP7o3tzRp-DI"),
    ORDER_STATUS_CHANGE_MSG("3", "订单状态变更通知" ,""),
    WORK_ORDER_TO_BE_ASSIGNEE_MSG("4", "待分配工单通知", ""),
    ORDER_REVISIT_LOG_CHANGE_MSG("5", "订单跟进记录变更通知", ""),
    ORDER_COLLABORATOR_LOG_CHANGE_MSG("6","订单协作人变更通知",""),
    ORDER_APPROVE_MSG("7","订单审批通知",""),
    ORDER_REVISIT_LOG_COMMENT_CHANGE_MSG("8", "订单跟进记录评论变更通知", ""),
    ORDER_CREATED_MSG("9", "订单创建完成通知", ""),
    APPROVAL_WORK_ORDER_COMPLETED("10","审批工单完成发送资产管理系统通知",""),
    JIAO_FU_ORDER_CANCELED("11","交付订单取消发送资产管理系统通知",""),
    OTHER("0", "其他", null);

    private String key;
    private String value;
    private String templateId;

    MessageSendType(String key, String value, String templateId) {
        this.key = key;
        this.value = value;
        this.templateId = templateId;
    }

    public static MessageSendType getEnumByKey(String key) {
        for (MessageSendType item : MessageSendType.values()) {
            if (item.getKey().equals(key)) {
                return item;
            }
        }
        return OTHER;
    }
}
